function Person () {
  this.hobbies = ['music', 'reading']
}
function Student () {
  // 构造函数继承，通过调用基类的构造函数来创建不同的属性
  // 注意，通过这种方法调用的基类的对象都是添加到当前对象上了
  Person.call(this)
}

var studenta = new Student();
var studentb = new Student();
console.log(studenta.hobbies, studentb.hobbies);
// ['music', 'reading'], ['music', 'reading']

studenta.hobbies.push('writing');
console.log(studenta.hobbies, studentb.hobbies);
// ['music', 'reading', 'writing'], ['music', 'reading']

// 在添加爱好时，针对的都是当前对象上的属性

console.log(studenta instanceof Student);

